package com.ftg.learn.exam.util;


import com.baomidou.mybatisplus.core.metadata.IPage;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;

import java.util.List;

/**
 * 用于查询功能返回的封装类
 * @author KangJx
 * @date 2021/4/22
 */
@Setter
@Getter
@ToString
public class QueryRuestType<T> extends ResultType {

    public QueryRuestType(IPage<T> ip){
        super(ConstType.OK,ConstType.QUERY_OK);
        this.setCount(ip.getTotal());
        this.setData(ip.getRecords());
    }

    /**
     * 一共有多少条
     */
    private long count;

    private List<T> data;


}
